package tests;
import org.opencv.core.Core;

import server.ConsoleFeedback;
import server.DefaultListeningService;
import server.DefaultSingleProtocol;
import server.DefaultUsersManager;
import server.Server;
import featuresProcessing.MatchingSystem;



public class Main {
	
	//RUN THIS TO START THE SERVER.
	
	public static final int GENERAL_SERVER_PORT = 4445;
	
	public static void main(String[] args) {

		System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
		
		Server s = Server.getSharedInstance();
		s.setParameters(new ConsoleFeedback(), new DefaultUsersManager(), new DefaultSingleProtocol(GENERAL_SERVER_PORT));
		s.addService(new DefaultListeningService());
		
		try {
			MatchingSystem.getSharedInstance().fetchDatabase();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(-1);
		}
		
		s.start();

	}
}